import React, {Component} from 'react'
import {connect} from 'react-redux'
import {getList} from './actions'

import './home.less'

class Home extends Component {
    constructor(props) {
        super(props)
    }

    componentDidMount() {
        this.props.getList({})
    }

    render() {
        console.log(this.props)

        return (
            <div className="home-container">
                I am home page
            </div>
        )
    }
}

const mapStateToProps = (state) => {
    return {
        home: state.home
    }
}

const mapDispatchToProps = (dispatch) => {
    return {
        getList: (params) => {
            dispatch(getList(params))
        }
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(Home) 